# -*- coding:utf-8 -*-
# @Author: shenyuyu
# @Time: 2023/6/28 17:53
# @File: qu_6_spark_sql_api_parquet_dataframe.py
from pyspark.sql import SparkSession
from pyspark.sql.types import StructType, StringType

if __name__ == '__main__':
    spark = SparkSession.builder.appName("test").master("local[*]").getOrCreate()

    # 读取text文档，把一行数据一个列的数据
    schema = StructType().add("name", StringType(), True)

    df = spark.read.format("parquet").load("file:///tmp/pycharm_project_161/data/sql/users.parquet")

    df.show()